package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLMathFP;

public class HLClassMathFP extends HLLibClass {
    public HLClassMathFP(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLMathFP();
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLMathFP.Round(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.Round(args.GetInt(0)));
            }
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                HLMathFP.ToInt(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.ToInt(args.GetInt(0)));
            }
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                HLMathFP.ToFP(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.ToFP(args.GetInt(0)));
            }
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                HLMathFP.ToFPEX(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.ToFPEX(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                HLMathFP.mul(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.mul(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                HLMathFP.div(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.div(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                HLMathFP.sqrt(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.sqrt(args.GetInt(0)));
            }
            break;
        }
        case 7: {
            if (resultOwnerObject == null) {
                HLMathFP.sin(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.sin(args.GetInt(0)));
            }
            break;
        }
        case 8: {
            if (resultOwnerObject == null) {
                HLMathFP.cos(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.cos(args.GetInt(0)));
            }
            break;
        }
        case 9: {
            if (resultOwnerObject == null) {
                HLMathFP.tan(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.tan(args.GetInt(0)));
            }
            break;
        }
        case 10: {
            if (resultOwnerObject == null) {
                HLMathFP.cot(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.cot(args.GetInt(0)));
            }
            break;
        }
        case 11: {
            if (resultOwnerObject == null) {
                HLMathFP.atan(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.atan(args.GetInt(0)));
            }
            break;
        }
        case 12: {
            if (resultOwnerObject == null) {
                HLMathFP.atan2(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.atan2(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        case 13: {
            if (resultOwnerObject == null) {
                HLMathFP.exp(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.exp(args.GetInt(0)));
            }
            break;
        }
        case 14: {
            if (resultOwnerObject == null) {
                HLMathFP.log(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.log(args.GetInt(0)));
            }
            break;
        }
        case 15: {
            if (resultOwnerObject == null) {
                HLMathFP.pow(args.GetInt(0), args.GetInt(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLMathFP.pow(args.GetInt(0), args.GetInt(1)));
            }
            break;
        }
        }
    }
}
